<include file="Public:header" />
<!-- MAIN CONTENT start -->
<literal>
    <style>
        .table th, .table td {
            text-align: center;
            /*height:38px;*/
        }
        .form-margin{
            margin-top: 15px;
            display: inline;
        }
        .progress{
            background: #C7CBCE;
        }
        .progress_margin{
            margin-bottom: 0;
        }
        .progress-bar-success{
            background: #8db22e;
        }
    </style>
</literal>
<div class="span12">
    <div class="well">
        <div>
            <span>按年级分类:</span>
            <empty name="sub_grade">
                <span class="label">全部</span>
                <else/>
                <a href="{:U('/Rank/index')}"><span class="label label-info">全部</span></a>
            </empty>
            <foreach name="grade" key="k" item="v_g">
                <if condition=" $v_g eq $sub_grade ">
                    <span class="label">{$v_g}</span>
                    <else/>
                    <a href="{:U('/Rank/index',array('grade'=>$v_g))}">
                        <span class="label label-info"><strong>{$v_g}</strong></span>
                    </a>
                </if>
            </foreach>
        </div>
        <div class="form-margin">
            <span >按时间分类：</span>
            <a href="{:U('Rank/Index')}">
                <span class="label <if condition='$time_tag neq 0'>label-info</if>"><strong>全部</strong></span>
            </a>
            <a href="{:U('Rank/Index',array('time_tag'=>4))}">
                <span class="label <if condition='$time_tag neq 4'>label-info</if>"><strong>&nbsp;年&nbsp;</strong></span>
            </a>
            <a href="{:U('Rank/Index',array('time_tag'=>3))}">
                <span class="label <if condition='$time_tag neq 3'>label-info</if>"><strong>&nbsp;月&nbsp;</strong></span>
            </a>
            <a href="{:U('Rank/Index',array('time_tag'=>2))}">
                <span class="label <if condition='$time_tag neq 2'>label-info</if>"><strong>&nbsp;周&nbsp;</strong></span>
            </a>
            <a href="{:U('Rank/Index',array('time_tag'=>1))}">
                <span class="label <if condition='$time_tag neq 1'>label-info</if>"><strong>&nbsp;日&nbsp;</strong></span>
            </a>
        </div>
        <form class="form-search form-margin">
            <input type="text" value="{$start_date}" name="start_date" placeholder="开始时间" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" style="width:186px;">
            <span>至</span>
            <input type="text" value="{$end_date}" name="end_date" placeholder="结束时间" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" style="width:186px;">
            <button type="submit" class="btn"><i class="icon-search"></i>Go!</button>
        </form>
        <form class="form-search form-margin">
            <span >用户：</span>
            <input type="text" name="user_id" value="" placeholder="学号"/>
            <button type="submit" class="btn"><i class="icon-search"></i>Go!</button>
        </form>
    </div>
    <div class="well blank-slate">
        <table class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th>名次</th>
                <th>用户</th>
                <th>昵称</th>
                <th>正确</th>
                <th>提交</th>
                <th>比率</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" key="k" item="v">
                <tr>
                    <td>
                        <empty name="p">
                            {$k+1}
                            <else/>
                            {$k+1+($p-1)*20}
                        </empty>
                    </td>
                    <td>
                        <a href="{:U('/User/index',array('id'=>$v['user_id']))}">{$v.user_id}</a>
                    </td>
                    <td>
                        {$v.nick}
                    </td>
                    <td>
                        <a href="{:U('Status/index',array('user_id'=>$v['user_id'],'result'=>4,'start_date'=>strtotime($start_date),'end_date'=>strtotime($end_date)))}">
                            <span class="badge badge-important">{$v.solved}</span>
                        </a>
                    </td>
                    <td>
                        <a href="{:U('Status/index',array('user_id'=>$v['user_id'],'start_date'=>strtotime($start_date),'end_date'=>strtotime($end_date)))}">
                            <span class="badge badge-info">{$v.submit}</span>
                        </a>
                    </td>
                    <td >
                        <div class="progress progress_margin">
                            <div class="progress-bar progress-bar-success" role="progressbar"
                                 aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
                                 style="width:{$v['solved']/$v['submit']*100|printf="%.1f",###}%">
                                <span class="sr-only">{$v['solved']/$v['submit']*100|printf="%.1f",###}%</span>
                            </div>
                        </div>
                    </td>
                </tr>
            </foreach>
            <tr>
                <td colspan="6" align="center"> {$page}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<!-- MAIN CONTENT end-->
<include file="Public:footer" />